#include <stdio.h>
#define maxn 41
int m[maxn][maxn];
int n;
int pr, pc, nr, nc;
int main() {
  scanf("%d", &n);
  pr = 0, pc = n/2;
  m[pr][pc] = 1;
  int num = n*n;
  for(int k=2; k<=num; ++k) {
    if(pr==0 && pc!=n-1) nr=n-1, nc=pc+1;
    else if(pr!=0 && pc==n-1) nr=pr-1, nc=0;
    else if(pr==0 && pc==n-1) nr=pr+1, nc=pc;
    else {
      if(m[pr-1][pc+1]==0) nr=pr-1, nc=pc+1;
      else nr=pr+1, nc=pc;
    }
    m[nr][nc] = k;
    pr=nr, pc=nc;
  }
  for(int i=0; i<n; ++i, putchar('\n'))
    for(int j=0; j<n; ++j) printf("%d ", m[i][j]);
}

